#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jul  2 10:43:48 2018

@author: chenliheng
"""

# lambda表达式：简化函数定义
def fun1(num):
    return num + 1

# lambda定义匿名函数
fun2 = lambda num: num+1

fun3 = lambda obj: print("打印内容" + str(obj))

# java8中存在lambda表达式 (x) => x+1

# 传统函数一样调用
print(fun1(4))
print(fun2(5))
fun3(8)